package com.ljh.springbootconsumer;

import com.ljh.common.model.User;
import com.ljh.common.service.UserService;
import com.ljh.myrpc.springboot.starter.annotation.RpcReference;
import org.springframework.stereotype.Service;

@Service
public class ExampleServiceImpl {
    @RpcReference // 表示需要远程服务提供者的服务
    private UserService userService;

    public void test(){
        User user = new User();
        user.setName("ljh22");
        User resultUser = userService.getUser(user);
        System.out.println("resultUser: " + resultUser.getName());
        long resultNumber = userService.getNumber();
        System.out.println("resultNumber: " + resultNumber);

    }
}
